<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich" %>
<% String contextRoot = request.getContextPath(); %>
<f:loadBundle basename="properties.messages" var="msg" />
<f:view>
<!doctype html>
<html>
<head>
	<%@ include file="include/meta.jsp" %>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<title>SISDEP : Sistema de Informaci<h:outputText value="#{msg.tilde_o}" />n de Espacio P<h:outputText value="#{msg.tilde_u}" />blico</title>
	<meta name="description" content="">
	<meta name="author" content="">
	<link rel="stylesheet" href="<%=contextRoot%>/css/validationEngine.jquery.css" type="text/css">
	<link rel="stylesheet" href="<%=contextRoot%>/css/template.css" type="text/css">
	<link rel="stylesheet" href="<%=contextRoot%>/css/normalize.css">
	<link rel="stylesheet" href="<%=contextRoot%>/css/uniform.css"> <!-- estilos formularios -->
	<link rel="stylesheet" href="<%=contextRoot%>/css/cuerpo.css">	
	<link rel="stylesheet" href="<%=contextRoot%>/css/richCustom.css">
</head>
<body>
	<div id="marco"> <!--inicio contenedor -->
		<div class="arriba-cuerpo"></div> <!-- Burrada pa ver borde redondo en IE -->
		<div class="cuerpo">
			<img src="<%=contextRoot%>/images/logos.png" />
			<div class="clear"></div>
			<!-- Menu y Usuario init() -->
			<%@ include file="include/menuUsuario.jsp"%>
			<!-- Menu y Usuario end() -->
			<div class="clear"></div>
			<!-- Formulario -->
			<div id="buscador">
				<h2>Gesti<h:outputText value="#{msg.tilde_o}" />n de Veh<h:outputText value="#{msg.tilde_i}" />culo: <h:outputText value="#{'NUEVO'}" /></h2>
				<h:form id="createVehiculoForm">
					<span class="left">
					<label>Tipo de Veh<h:outputText value="#{msg.tilde_i}" />culo <span class="asterisco">*</span></label>
							<h:selectOneMenu id="idVehiculoTipo" styleClass="validate[required]" value="#{vehiculoController.vehiculo.idVehiculoTipoStr}">
								<f:selectItem itemLabel="Seleccione..." itemValue=""/>
								<f:selectItems value="#{masterListCache.vehicleTypeList}"/>
							</h:selectOneMenu>
					</span>
					<span class="left" style="margin-left: 10%;">
					<label>Placa<span class="asterisco">*</span></label>
						<h:inputText id="codigo" size="6" maxlength="6" styleClass="validate[required,custom[onlyLetterNumber]]"
									value="#{vehiculoController.vehiculo.placa}" />
					</span>
					<span class="left" style="margin-left: 10%;">
					<label>Municipio <span class="asterisco">*</span></label>
						<h:inputText id="municipio" size="30" maxlength="30" styleClass="validate[required,custom[onlyLetterNumber]]"
									value="#{vehiculoController.vehiculo.municipio}" />
					</span>
					<div class="clear"></div> <br/>
					<span class="left">
					<label>Marca <span class="asterisco">*</span></label>
						<h:inputText id="marca" size="30" maxlength="30" styleClass="validate[required]"
									value="#{vehiculoController.vehiculo.marca}" />
					</span>
					<span class="left" style="margin-left: 10%;">
					<label>Modelo - A<h:outputText value="#{msg.tilde_n}" />o  <span class="asterisco">*</span></label>
						<h:inputText id="modelo" size="8" maxlength="4" styleClass="validate[required,custom[onlyNumberSp]]"
									value="#{vehiculoController.vehiculo.modelo}" />
					</span>
					<span class="left" style="margin-left: 5%;">
					<label>Chasis </label>
						<h:inputText id="chasis" size="30" maxlength="60"
									value="#{vehiculoController.vehiculo.chasis}" />
					</span>
					<div class="clear"></div> <br/>
					<span class="left" >
					<label>M<h:outputText value="#{msg.tilde_o}" />vil </label>
						<h:inputText id="movil" size="10" maxlength="10" styleClass=""
									value="#{vehiculoController.vehiculo.movil}" />
					</span>
					<span class="left" style="margin-left: 10%;">
					<label>Capacidad <span class="asterisco">*</span> </label>
						<h:inputText id="capacidad" size="5" maxlength="3" styleClass="validate[required,custom[onlyNumberSp]]"
									value="#{vehiculoController.vehiculo.capacidad}" />
					</span>
					<span class="left" style="margin-left:10%;">
						<label>Estado <span class="asterisco">*</span></label>
							<h:selectOneMenu id="estado" styleClass="validate[required]"
												value="#{vehiculoController.vehiculo.estado}">
                                <f:selectItem itemLabel="Seleccione..." itemValue=""/>
                                <f:selectItem itemLabel="Nuevo" itemValue="NUEVO"/>
                                <f:selectItem itemLabel="Disponible" itemValue="DISPONIBLE"/>
                                <f:selectItem itemLabel="Ocupado" itemValue="OCUPADO"/>
                            </h:selectOneMenu>
					</span>
					<div class="clear"></div>					<br/>
					<span class="left" style="margin-left: 0px;">
					<label>Descripci<h:outputText value="#{msg.tilde_o}" />n </label>
									<h:inputTextarea id="descripcion"  styleClass="validate[maxSize[255]]"
							style="width:400px !important; min-width:400px !important; max-width:400px !important; height:80px !important; min-height:80px !important; max-height:80px !important; "
							value="#{vehiculoController.vehiculo.descripcion}" >
							</h:inputTextarea>
					</span>
					<div class="clear"></div>					<br/>
					(<span class="asterisco"> * </span>) : Campo Obligatorio
					<div class="clear"></div>
					<span class="left inline">
						<h:commandButton id="createVehiculoButton"
							styleClass="botonsmall"
							type="submit" 
							value="Guardar" 
							ondblclick="return false;" 
							action="#{vehiculoController.create}" >
						</h:commandButton>
					</span>
				</h:form>
				<span class="left inline">
					<h:form id="cleanVehiculoForm">
						<h:commandButton id="cleanVehiculoButton"
										 styleClass="botonsmall"
										 type="submit" 
										 value="Limpiar" 
										 ondblclick="return false;" 
										 action="#{vehiculoController.createVehiculo}" >
						</h:commandButton>		
					</h:form>
				</span>
			</div>
			<!-- Fin formulario div buscador !!! -->
			<div class="clear"></div>
			<div>
			    <h:form id="cancelVehiculoForm">
					<h:commandButton id="cancelCreateVehiculoButton"
							 styleClass="botonsmall" 
							 type="submit" 
							 value="Cancelar" 
							 ondblclick="return false;" 
							 action="#{vehiculoController.cancelVehiculo}" >
					</h:commandButton>
				</h:form>
			</div>
			<!-- Fin tabla -->
			<div class="clear"></div>
		</div><!-- Fin DIV CUERPO -->
		<div class="abajo-cuerpo"></div>
		<!-- Burrada pa ver borde redondo en IE -->
	</div>
	<!-- Fin contenedor -->
	<div class="footer"></div>
	<script src="<%=contextRoot%>/js/jquery/lib/jquery-1.7.2.min.js"></script>
	<script src="<%=contextRoot%>/js/script.js"></script>	
	<script src="<%=contextRoot%>/js/jquery.maskedinput-1.3.js"	type="text/javascript"></script>
	<script src="<%=contextRoot%>/js/jquery/lib/jquery.uniform.min.js"></script>
	<!-- formularios -->
	<script	src="<%=contextRoot%>/js/jquery/lib/jquery.validationEngine-es.js" type="text/javascript" charset="utf-8"></script>
	<script	src="<%=contextRoot%>/js/jquery/lib/jquery.validationEngine.js"	type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" charset="utf-8">
		jQ(document).ready(function() {
			jQ("input, select, input:checkbox, input:radio, input:file").uniform();
			jQ("#createVehiculoForm").validationEngine('attach');
			jQ("#createVehiculoForm").bind("jqv.form.result", function(event, errorFound) {
				if (!errorFound)
					displayLoadingImage();
				});
		});
	</script>
	<%@ include file="include/validationStatus.jsp"%>
	<%@ include file="include/modalMessageWindow.jsp"%>
</body>
</html>
</f:view>